package com.mayuran19.portal.accounting.database.domain;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

import com.mayuran19.portal.common.database.domain.DomainObject;

@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
public class Account extends DomainObject {
	private Long id;
	private Date date;
	private BigDecimal amount;
	private AccountCatagory accountCatagory;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "account_catagory_id")
	public AccountCatagory getAccountCatagory() {
		return accountCatagory;
	}

	public void setAccountCatagory(AccountCatagory accountCatagory) {
		this.accountCatagory = accountCatagory;
	}

}
